from django import forms
from django import forms
from captcha.fields import CaptchaField

class UserForm(forms.Form):
    uname = forms.CharField(label="用户名", max_length=128, widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': "Username",'autofocus': ''}))
    upwd = forms.CharField(label="密码", max_length=256, widget=forms.PasswordInput(attrs={'class': 'form-control',  'placeholder': "Password"}))
    # captcha = CaptchaField(label='验证码')

class RegisterForm(forms.Form):
    gender = (
        ('male', "男"),
        ('female', "女"),
    )
    uname = forms.CharField(label="用户名", max_length=128, widget=forms.TextInput(attrs={'class': 'form-control'}))
    upwd1 = forms.CharField(label="密码", max_length=256, widget=forms.PasswordInput(attrs={'class': 'form-control'}))
    upwd2 = forms.CharField(label="确认密码", max_length=256, widget=forms.PasswordInput(attrs={'class': 'form-control'}))
    uemail = forms.EmailField(label="邮箱地址", widget=forms.EmailInput(attrs={'class': 'form-control'}))
    utel = forms.CharField(label="电话号码", max_length=128, widget=forms.TextInput(attrs={'class': 'form-control'}))
    usex = forms.ChoiceField(label='性别', choices=gender)
    # captcha = CaptchaField(label='验证码')


class IncomeForm(forms.Form):
    iType = forms.CharField(label="类型", max_length=30)  # 类型（借入、收入）
    iMoney = forms.DecimalField(label="金额", max_digits=10, decimal_places=2)  # 金额
    iRemark = forms.CharField(label="备注", max_length=55)  # 备注
    iTime = forms.DateField(label="时间")   # 时间

class PayForm(forms.Form):
    pType = forms.CharField(label="类型", max_length=30)  # 类型（借出、支出）
    pMoney = forms.DecimalField(label="金额", max_digits=10, decimal_places=2)  # 金额
    pRemark = forms.CharField(label="备注", max_length=55)  # 备注
    pTime = forms.DateField(label="时间")   # 时间